//
//  Auction_SpecialSaleDetailsPreferentialPrice_Cell_WX.m
//  ZITHER
//
//  Created by weixin on 2019/6/3.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "Auction_SpecialSaleDetailsPreferentialPrice_Cell_WX.h"

@implementation Auction_SpecialSaleDetailsPreferentialPrice_Cell_WX

- (void)awakeFromNib {
    [super awakeFromNib];
    self.viewBorder.backgroundColor = HexColor(0xf5f5f5);
    [self.viewBorder setCornerRadiusWithRadius:6 isMasks:YES];
    [self.viewBorder mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(10);
        make.left.equalTo(self).offset(14);
        make.right.equalTo(self).offset(-14);
        make.bottom.equalTo(self).offset(0);
    }];
    [self setUI];
}

-(void)setModel:(specialSaleSceneidDetails *)model{
    _model = model;
    self.PreferentialLab.text = [NSString stringWithFormat:@"%ld折资格券",model.discount*10];
    self.participantsLab.text = [NSString stringWithFormat:@"%ld人已经领取",model.obtainVolumeNum];
    self.shopNameLab.text = model.userNick;
    self.PreferentialPriceLab.text = [NSString stringWithFormat:@"折后价约 ¥%ld",model.priceDiscount];
    self.UseInformationDetailsLab.text = model.notice;

    //折扣店  _discount    NSInteger    0
    //折扣价格 _priceDiscount    NSInteger    32665
    //_obtainVolumeNum    NSInteger    0
    //_userNick    __NSCFString *    @"最新的店"    0x00006000003152a0
    //使用须知 [5]    (null)    @"notice" : @""
    /**
     @property (nonatomic,strong)BaseLab * PreferentialLab;
     @property (nonatomic,strong)BaseLab * PreferentialPriceLab;
     
     @property (nonatomic,strong)BaseLab * participantsLab;
     
     
     @property (nonatomic,strong)BaseLab * shopLab;
     @property (nonatomic,strong)BaseLab * shopNameLab;
     
     @property (nonatomic,strong)BaseLab * UseInformationLab;
     @property (nonatomic,strong)BaseLab * UseInformationDetailsLab;
    
     */
}

-(void)setUI{
    
    [self.PreferentialLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(25);
        make.left.equalTo(self).offset(30);
        make.height.mas_equalTo(20);
    }];
    
    [self.PreferentialPriceLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.PreferentialLab.mas_bottom).offset(10);
        make.left.equalTo(self).offset(30);
        make.height.mas_equalTo(15);
    }];
    [self.participantsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-30);
        make.centerY.equalTo(self.PreferentialLab).offset(0);
    }];
    
    [self.shopLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.PreferentialPriceLab.mas_bottom).offset(15);
        make.left.equalTo(self).offset(30);
        make.height.mas_equalTo(13);
    }];
    
    [self.shopNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.shopLab.mas_bottom).offset(5);
        make.left.equalTo(self).offset(30);
        make.height.mas_equalTo(14);
    }];
    
    [self.UseInformationLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.shopNameLab.mas_bottom).offset(20);
        make.left.equalTo(self).offset(30);
        make.height.mas_equalTo(14);
    }];
    [self.UseInformationDetailsLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.UseInformationLab.mas_bottom).offset(5);
        make.left.equalTo(self).offset(30);
        make.right.equalTo(self).offset(-30);
        make.bottom.equalTo(self.mas_bottom).offset(-15);
    }];
}

-(BaseLab *)PreferentialLab{
    if (!_PreferentialLab) {
        _PreferentialLab = [BaseLab initCustomLab:@"7折资格券" color:HexColor(0xFF6F6F) font:[UIFont fontWithName:@"PingFangSC-Semibold" size:17]];
        _PreferentialLab.backgroundColor = [UIColor clearColor];
        [self addSubview:_PreferentialLab];
    }
    return _PreferentialLab;
}

-(BaseLab *)participantsLab{
    if (!_participantsLab) {
        _participantsLab = [BaseLab initCustomLab:@"800人已经领取" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
        _participantsLab.backgroundColor = [UIColor clearColor];
        [self addSubview:_participantsLab];
        
    }
    return _participantsLab;
}

-(BaseLab *)PreferentialPriceLab{
    if (!_PreferentialPriceLab) {
        _PreferentialPriceLab = [BaseLab initCustomLab:@"折后价约 ¥800" color:HexColor(0xFF6F6F) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:14]];
        _PreferentialPriceLab.backgroundColor = [UIColor clearColor];
        [self addSubview:_PreferentialPriceLab];
    }
    return _PreferentialPriceLab;
}

-(BaseLab *)shopLab{
    if (!_shopLab) {
        _shopLab = [BaseLab initCustomLab:@"使用店铺" color:HexColor(0x999999) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
        _shopLab.backgroundColor = [UIColor clearColor];
        [self addSubview:_shopLab];
    }
    return _shopLab;
}

-(BaseLab *)shopNameLab{
    if (!_shopNameLab) {
        _shopNameLab = [BaseLab initCustomLab:@"太子表行XXXXXX店" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:14]];
        _shopNameLab.backgroundColor = [UIColor clearColor];
        [self addSubview:_shopNameLab];
    }
    return _shopNameLab;
}

-(BaseLab *)UseInformationLab{
    if (!_UseInformationLab) {
        _UseInformationLab = [BaseLab initCustomLab:@"使用须知" color:HexColor(0x999999) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
        _UseInformationLab.backgroundColor = [UIColor clearColor];
        [self addSubview:_UseInformationLab];
    }
    return _UseInformationLab;
}

-(BaseLab *)UseInformationDetailsLab{
    if (!_UseInformationDetailsLab) {
        _UseInformationDetailsLab = [BaseLab initCustomLab:@"本券有效期为领取后30天内 使用时请提前\n使用时请联系商家\n真实金额购买回会受香港公价汇率变动哦印象" color:HexColor(0x999999) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
        _UseInformationDetailsLab.numberOfLines = 0;
        _UseInformationDetailsLab.backgroundColor = [UIColor clearColor];
        [self addSubview:_UseInformationDetailsLab];
    }
    return _UseInformationDetailsLab;
}

/**
 
 @property (nonatomic,strong)BaseLab * PreferentialLab;
 @property (nonatomic,strong)BaseLab * PreferentialPriceLab;
 
 @property (nonatomic,strong)BaseLab * participantsLab;
 
 
 @property (nonatomic,strong)BaseLab * shopLab;
 @property (nonatomic,strong)BaseLab * shopNameLab;
 
 @property (nonatomic,strong)BaseLab * UseInformationLab;
 @property (nonatomic,strong)BaseLab * UseInformationDetailsLab;
 
 */


@end
